1. Field of the Invention
The present invention relates in general to a data or text processing system having a search-and-replace function and capable of handling attribute data which designates the manner in which entered text is printed. More particularly, the invention is concerned with a data replacing operation wherein when a certain group of successive characters in a memory is searched and replaced by a designated group of replacement characters, attribute data stored for the leading (first) character of the searched group is stored in the memory so that all the replacement characters newly stored in the memory are printed in a manner designated by the attribute data.
2. Discussion of the Prior Art
A word processor and an electronic typewriter are commonly known as a text processing system. Usually, these text processing systems have a search-and-replace function of replacing a given group of character data by another group of character data, and a function of handling attribute data which designates the manner in which the character data is printed.
For example, underscoring data is known as a typical kind of attribute data. Described more specifically, when an underscoring mode is established by a suitable key during entry of text data, a desired group of successive characters may be underscored when the characters are printed. When the search-and-replace function is executed to replace a certain word in a text memory by a desired replacement word, the word to be replaced is entered through a keyboard, and the text memory is scanned to search for the entered word. The search word is replaced by the desired replacement word which is also entered through the keyboard. In this search-and-replace operation, the following problem is conventionally encountered in connection with the attribute data.
In the text memory of a text processing system such as the word processor and electronic typewriter described above, character data representative of a character which is normally printed is stored without attribute data appended thereto. On the other hand, character data representative of a character which is printed in a special manner is stored in combination with the appropriate attribute data appended thereto. The conventional processing system is classified into two types, in terms of handling attribute data when a search-and-replace function is executed where character data in the text memory which is to be replaced is accompanied with the attribute data.
In the first type of search-and-replace arrangement, the attribute data of the group of characters to be replaced is ignored. Namely, the attribute data is erased when the searched group of characters is replaced by a group of replacement characters. In this case, the erased attribute data must be re-entered through the appropriate key, and the data editing efficiency of the text processing system is lowered.
In the second type of search-and-replace arrangement, the data replacing operation includes a step of determining whether each set of character data of the searched group of characters to be replaced is accompanied with attribute data or not. According to this determination, the attribute data is appended to the character data of each replacement character, which replaces the searched character data accompanied with the attribute data. This arrangement requires a considerably complicated control program for performing the search-and-replace operation, and suffers from a low data processing speed in the search-and-replace operation. Further, the same arrangement suffers from a problem that the attribute data will not be appended to the character data of a last replacement character or characters which do not correspond to the characters of the searched group to be replaced, because the number of the replacement characters exceeds that of the characters to be replaced.